]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
popupMenu: Ensure that submenus are properly hidden when insensitive
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 12 Jun 2013 07:35:28 +0000 (03:35 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 15 Jul 2013 16:34:23 +0000 (12:34 -0400)
We don't actually propagate sensitivity information to submenus; we
simply make sure that they can never be open when the parent is
insensitive.

https://bugzilla.gnome.org/show_bug.cgi?id=702539

js/ui/popupMenu.js

index e14f75d4fbf182651ad38f2e8501d48383ee8496..5918c93f69d8c8eb0f39d0cd02bc34dfbd8322d9 100644 (file)
@@ -1340,6 +1340,13 @@ const PopupSubMenuMenuItem = new Lang.Class({
         this.menu.connect('open-state-changed', Lang.bind(this, this._subMenuOpenStateChanged));
     },
 
+    syncSensitive: function() {
+        let sensitive = this.parent();
+        this._triangle.visible = sensitive;
+        if (!sensitive)
+            this.menu.close(false);
+    },
+
     _subMenuOpenStateChanged: function(menu, open) {
         if (open)
             this.actor.add_style_pseudo_class('open');